Reference for Bava Metzia 28:8
לא בבעל חוב
— Rab says: He [the buyer] is entitled to [the return of the money [which he paid for the field] and to [compensation from the seller for the] improvement [which he made in the field].<span class="x" onmousemove="('comment',' If during his tenure of the field the buyer improved it by manure or by erecting a fence round it, he may claim compensation from the seller. The obvious question why the original (rightful) owner, who regains possession of his field, is not made to pay for the improvement, may be answered by referring to a case where the seller allowed the field to deteriorate after taking it away from the rightful owner, and the buyer only restored it to its original condition so that the original owner derives no actual benefit from the change (Rashi). ');"><sup>8</sup></span>